package com.recipefinder.util;

import java.util.Comparator;

import com.recipefinder.bean.Ingredient;

public class IngredientComparator implements Comparator<Ingredient> {

	@Override
	public int compare(Ingredient one, Ingredient another) {
		if(one.getUseBy().before(another.getUseBy()))
			return -1;
		else if(one.getUseBy().after(another.getUseBy()))
			return 1;
		else return 0;
	}

}
